<?php
defined('InNcPHP') or exit('Access Invalid!');

/**
 * 门票订单里的商品
 * Class order_ticketModel
 */
class order_ticketModel extends Model{

	public function __construct(){
		parent::__construct('order_ticket');
	}

    /**
     * 获取订单里的门票列表
     * @param array $condition
     * @return mixed
     */
	public function getOrderTicketList($condition = array()){
        return $this->table('order_ticket,ticket_type')
            ->field('*')
            ->join('left')
            ->on('order_ticket.type_id=ticket_type.type_id')
            ->where($condition)
            ->select();
    }

    /**
     * 插入一条记录
     * @param array $params
     * @return mixed
     */
    public function addOrderTicket($params)
    {
        return $this->table('order_ticket')->insert($params);
    }
}
?>